import torch


# 1.张量类型转换 data.type(torch.DoubleTensor) 转换为Double也就是float64

data = torch.full([2, 3],10)
print(data.dtype)
print(data)
data = data.type(torch.DoubleTensor) # float64
print(data.dtype)
print(data)
data = data.type(torch.FloatTensor) # float32
print(data.dtype)
print(data)
data = data.type(torch.LongTensor) # int64
print(data.dtype)
print(data)
data = data.type(torch.IntTensor) # int32
print(data.dtype)
print(data)